<html>
<head><meta charset="utf-8"><title>How to get fn param list span · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20get.20fn.20param.20list.20span.html">How to get fn param list span</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216393910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20get%20fn%20param%20list%20span/near/216393910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20get.20fn.20param.20list.20span.html#216393910">(Nov 11 2020 at 20:17)</a>:</h4>
<p>Given an LocalDefId which is definitely pointing to some kind of fn, how can I get the span of the parameter list? (EG, <code>(a: i32)</code> or <code>()</code>)</p>



<a name="216400920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20get%20fn%20param%20list%20span/near/216400920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20get.20fn.20param.20list.20span.html#216400920">(Nov 11 2020 at 21:26)</a>:</h4>
<p>hmm, I don't know if you can get <em>just</em> the parameter list</p>



<a name="216400938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20get%20fn%20param%20list%20span/near/216400938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20get.20fn.20param.20list.20span.html#216400938">(Nov 11 2020 at 21:26)</a>:</h4>
<p>for the span of the function signature, you can use <code>def_span</code> <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html?search=#method.def_span">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html?search=#method.def_span</a></p>



<a name="216410216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20get%20fn%20param%20list%20span/near/216410216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20get.20fn.20param.20list.20span.html#216410216">(Nov 11 2020 at 23:24)</a>:</h4>
<p>Thank you, I think the signature is really what I want anyways</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>